The Dreamweaver JavaScript API > Deprecated functions > dreamweaver.getBehaviorEvent() |
![]() ![]() ![]() |
dreamweaver.getBehaviorEvent()
Availability
Dreamweaver 1.2, deprecated in 2.0 because actions are now chosen before events.
Description
In a Behavior action file, gets the event that triggers this action.
Arguments
None.
Returns
A string representing the event. This is the same string that is passed as an argument (event
) to the canAcceptBehavior()
function.
Example
The following instance of getBehaviorEvent()
is from the initializeUI()
function in the Drag Layer action file. The role of the following snippet is similar to that of canAcceptBehavior()
that is, it checks whether the selected event is appropriate for the selected action. Such a construct is more useful than canAcceptBehavior()
, because it lets you offer the user some guidance about which events are suitable for calling the selected action. canAcceptBehavior()
can make the action unavailable in the Actions pop-up menu only if the user chooses an inappropriate event.
theEvent = dreamweaver.getBehaviorEvent().toLowerCase(); CANBEAPPLIED = (theEvent != "onmousedown" && theEvent != ¬ "onmousemove"); if (CANBEAPPLIED) { [display the Drag Layer UI] } else{ [display a helpful message that tells the user which events ¬ are appropriate for the Drag Layer action.] }
![]() ![]() ![]() |